package com.java.collection.comparer;

public class Manager implements Comparable<Manager>{
	
	private int id;
	
	private String name;
	
	public Manager(int id,String name){
		this.id = id;
		this.name = name;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public String toString(){
		return this.name;
	}

	@Override
	public int compareTo(Manager obj) {
		//System.out.println(this.getName()+"-------------"+obj.getName());
		//前面的元素比和后面的元素，大于0，交换  升序
		return this.name.compareTo(obj.name);
	}
	
}
